package com.tonyodev.fetch2core;

import ohos.utils.Sequenceable;

/**
 * Class used to hold partial downloaded information for a download.
 *
 * @since 2021-05-20
 */
public interface DownloadBlock extends Sequenceable {
    /**
     * id
     *
     * @return Download ID.
     */
    int getDownloadId();

    /**
     * BlockPosition
     *
     * @return Position in the downloading block sequence.
     */
    int getBlockPosition();

    /**
     * 开始字节
     *
     * @return Block start position.
     */
    long getStartByte();

    /**
     * 结束字节
     *
     * @return Block end position.
     */
    long getEndByte();

    /**
     * 下载字节
     *
     * @return Downloaded bytes in block.
     */
    long getDownloadedBytes();

    /**
     * 进度
     *
     * @return Progress completion of block.
     */
    int getProgress();

    /**
     * 复制
     *
     * @return Copy DownloadBlock object.
     */
    DownloadBlock copy();
}
